﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Argument.Is
{
    [TestClass]
    public class InAttributeTest
    {
        [Arcana.Contract.Argument.Is.In("role", new object[] { "user", "admin" })]
        public static void Target_1(string role)
        {
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentException))]
        public void ShouldThrowException_1()
        {
            Target_1("User");
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentException))]
        public void ShouldThrowException_2()
        {
            Target_1("admiN");
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        public void ShouldPass()
        {
            Target_1("user");
            Target_1("admin");
        }
    }
}
